<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>arduino-audio-driver: src/Utils/I2C.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">arduino-audio-driver
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_a7363e98f9e0bdd87618633653859815.html">Utils</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">I2C.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
<code>#include &quot;<a class="el" href="_common_8h_source.html">Common.h</a>&quot;</code><br />
</div>
<p><a href="_i2_c_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af875a59327f98cb9ae843ede8587fef3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_common_8h.html#a9ad6b2dc3cbff040775e79656fe8e1a3">error_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_i2_c_8h.html#af875a59327f98cb9ae843ede8587fef3">i2c_bus_check</a> (<a class="el" href="_common_8h.html#a7031876dbed79a4a0cf1a5f82970275c">i2c_bus_handle_t</a> bus, int addr)</td></tr>
<tr class="memdesc:af875a59327f98cb9ae843ede8587fef3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Requests ACK from I2C device.  <a href="_i2_c_8h.html#af875a59327f98cb9ae843ede8587fef3">More...</a><br /></td></tr>
<tr class="separator:af875a59327f98cb9ae843ede8587fef3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac55a996bcf945a17aa3ddfb1525e1e8e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_common_8h.html#a9ad6b2dc3cbff040775e79656fe8e1a3">error_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_i2_c_8h.html#ac55a996bcf945a17aa3ddfb1525e1e8e">i2c_bus_read_bytes</a> (<a class="el" href="_common_8h.html#a7031876dbed79a4a0cf1a5f82970275c">i2c_bus_handle_t</a> bus, int addr, uint8_t *reg, int reglen, uint8_t *outdata, int datalen)</td></tr>
<tr class="memdesc:ac55a996bcf945a17aa3ddfb1525e1e8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read bytes to I2C bus.  <a href="_i2_c_8h.html#ac55a996bcf945a17aa3ddfb1525e1e8e">More...</a><br /></td></tr>
<tr class="separator:ac55a996bcf945a17aa3ddfb1525e1e8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33733ea17940e828fc5aa7ed9aa3034a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_common_8h.html#a9ad6b2dc3cbff040775e79656fe8e1a3">error_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_i2_c_8h.html#a33733ea17940e828fc5aa7ed9aa3034a">i2c_bus_write_bytes</a> (<a class="el" href="_common_8h.html#a7031876dbed79a4a0cf1a5f82970275c">i2c_bus_handle_t</a> bus, int addr, uint8_t *reg, int regLen, uint8_t *data, int datalen)</td></tr>
<tr class="memdesc:a33733ea17940e828fc5aa7ed9aa3034a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write bytes to I2C bus.  <a href="_i2_c_8h.html#a33733ea17940e828fc5aa7ed9aa3034a">More...</a><br /></td></tr>
<tr class="separator:a33733ea17940e828fc5aa7ed9aa3034a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="af875a59327f98cb9ae843ede8587fef3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af875a59327f98cb9ae843ede8587fef3">&#9670;&nbsp;</a></span>i2c_bus_check()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_common_8h.html#a9ad6b2dc3cbff040775e79656fe8e1a3">error_t</a> i2c_bus_check </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_common_8h.html#a7031876dbed79a4a0cf1a5f82970275c">i2c_bus_handle_t</a>&#160;</td>
          <td class="paramname"><em>bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Requests ACK from I2C device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bus</td><td>I2C bus handle </td></tr>
    <tr><td class="paramname">addr</td><td>The address of the device</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>NULL Fail</li>
<li>Others Success </li>
</ul>
</dd></dl>

</div>
</div>
<a id="ac55a996bcf945a17aa3ddfb1525e1e8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac55a996bcf945a17aa3ddfb1525e1e8e">&#9670;&nbsp;</a></span>i2c_bus_read_bytes()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_common_8h.html#a9ad6b2dc3cbff040775e79656fe8e1a3">error_t</a> i2c_bus_read_bytes </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_common_8h.html#a7031876dbed79a4a0cf1a5f82970275c">i2c_bus_handle_t</a>&#160;</td>
          <td class="paramname"><em>bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>reg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>reglen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>outdata</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>datalen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read bytes to I2C bus. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bus</td><td>I2C bus handle </td></tr>
    <tr><td class="paramname">addr</td><td>The address of the device </td></tr>
    <tr><td class="paramname">reg</td><td>The register of the device </td></tr>
    <tr><td class="paramname">regLen</td><td>The length of register </td></tr>
    <tr><td class="paramname">outdata</td><td>The outdata pointer </td></tr>
    <tr><td class="paramname">datalen</td><td>The length of outdata</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>NULL Fail</li>
<li>Others Success</li>
</ul>
</dd></dl>
<p>Read bytes to I2C bus. </p>

</div>
</div>
<a id="a33733ea17940e828fc5aa7ed9aa3034a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a33733ea17940e828fc5aa7ed9aa3034a">&#9670;&nbsp;</a></span>i2c_bus_write_bytes()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_common_8h.html#a9ad6b2dc3cbff040775e79656fe8e1a3">error_t</a> i2c_bus_write_bytes </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_common_8h.html#a7031876dbed79a4a0cf1a5f82970275c">i2c_bus_handle_t</a>&#160;</td>
          <td class="paramname"><em>bus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>reg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>regLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>datalen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write bytes to I2C bus. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bus</td><td>I2C bus handle </td></tr>
    <tr><td class="paramname">addr</td><td>The address of the device </td></tr>
    <tr><td class="paramname">reg</td><td>The register of the device </td></tr>
    <tr><td class="paramname">regLen</td><td>The length of register </td></tr>
    <tr><td class="paramname">data</td><td>The data pointer </td></tr>
    <tr><td class="paramname">datalen</td><td>The length of data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>NULL Fail</li>
<li>Others Success </li>
</ul>
</dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
